<?php
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-log.php");
?>



<?
//用来判断当前系统属于什么板块
$detail=select_one_line_all_items($table_Prefix."renewal","nid = ".$_REQUEST['nid']."");
$renewal_history=select_lines_all_items($table_Prefix."renewal_log","next_enddate","parent_nid = ".$_REQUEST['nid']."","");
$relate_renewal=select_lines_all_items($table_Prefix."renewal","nid desc","unit = '".$detail['unit']."'","");

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
<?php include 'modules/head.php'; ?>

</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="renewal_log">

    <div id="maincontent">

        <div id="sidebar">
        <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>

<div id="content">

    <?php $page_title='相关续费';?>
    <?php include ROOT_PATH_.'/controller/common/module/mod-page-title.php'; ?>
    <div class="list-box  detail-box">
    <div class="shrinker"> 如果需要针对某项目做补充说明，可以在本页面填写备注。备注会在导出文件对应项目显示出来。</div>
    <form class="layui-form " action="renewal_bill_export.php" enctype="multipart/form-data" >


    <table class="layui-table">
        <colgroup>
            <col width="60">
            <col width="280">
            <col width="270">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>选择</th>
            <th>续费项目</th>
            <th>金额</th>
            <th>下次到期</th>
            <th>备注</th>
        </tr>
        </thead>
        <tbody>

        <?
        for($i=0;$i<count($relate_renewal);$i++){ ?>
            <tr>
                <td><input type="checkbox" value="<?echo $relate_renewal[$i]['nid']?>" name="nid[]" class="" lay-skin="primary" ></td>
                <td><? echo $relate_renewal[$i]['name']; ?> - <? echo $relate_renewal[$i]['type']; ?></td>
                <td><? echo $relate_renewal[$i]['sum']; ?> </td>
                <td><? echo $relate_renewal[$i]['next_enddate']; ?>  --  状态 <? echo $relate_renewal[$i]['status']; ?></td>
                <td>
                    <input type="text" name="remark[<?echo $i?>]"  class="layui-input" >
                </td>
            </tr>

        <? } ?>

        </tbody>
    </table>

        <div class="function"><button type="submit" style="margin-left: 20px;" class="layui-btn layui-btn-sm" id="export_item">生成续费文件</button>
         </div>
    </form>
    </div>


<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>








<?php include_once('../modules/footer.php'); ?>

<!--<script type="text/javascript">-->
<!--    $('#export_item').click(function(){-->
<!--        let nids = '';-->
<!--        $.each($("input[name='nid[]']"),function(){-->
<!--            if(this.checked){-->
<!--                console.log($(this).val())-->
<!--                nids += $(this).val() + ','-->
<!--            }-->
<!--        });-->
<!---->
<!--        if(nids){-->
<!--            window.open('renewal_bill_export.php?nid=--><?//echo $_REQUEST['nid']?>
<!--//'+'&nids='+nids.substr(0,nids.length - 1))-->
<!--//        }else {-->
<!--//            alert("最少选择一项")-->
<!--//        }-->
<!--//-->
<!--//    })-->
<!--//</script>-->
</body>
</html>
